Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TimePicker2): should support custom formatting close ##3651 #4803

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

YunMeng99
Copy link
Contributor

No description provided.

@@ -402,7 +402,8 @@ class TimePicker2 extends Component {

checkValue = (value, strictly) => {
const { inputType } = this.state;
const formatter = v => (typeof v === 'string' ? datejs(v, 'HH:mm:ss') : v);
const { format } = this.props;
const formatter = v => (typeof v === 'string' ? datejs(v, format ? format : 'HH:mm:ss') : v);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

props.format 是有默认值的,这里直接用就行了

assert(
document.querySelector('li[title="12"][role="option"]').classList.contains('next-selected')
);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用例内容与用户实际问题不符,用户的问题是 type "12" 不能选中 12 那一项,一定要 type "12:00:00" 才能匹配 12 那一项

@YunMeng99 YunMeng99 requested a review from YSMJ1994 March 28, 2024 02:34
@YSMJ1994 YSMJ1994 merged commit aac4730 into master Apr 3, 2024
2 of 4 checks passed
@YSMJ1994 YSMJ1994 deleted the feat/TimePicker2-custom-formatting branch April 3, 2024 02:38
eternalsky pushed a commit that referenced this pull request Jul 16, 2024
)

* fix(TimePicker2): should support custom formatting close ##3651

* feat(TimePicker2): test case modification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TimePicker2]TimePicker2 with specified format can only recognise full input
2 participants